import request from '@/utils/request'

// 货主分页查询
export const getOwnerList = (params: any) =>
  request({
    url: '/owner/page',
    method: 'get',
    params
  })

// 货主详情
export const getListDetails = (id: any) =>
  request({
    url: `/owner/detail/${id}`,
    method: 'get'
  })

// 删除
export const deleteOwner = (params: any) =>
  request({
    url: '/owner',
    method: 'delete',
    params
  })
// 新增
export const addOwner = (data: any) =>
  request({
    url: '/owner',
    method: 'post',
    data
  })
// 编辑
export const updateOwner = (data: any) =>
  request({
    url: '/owner',
    method: 'put',
    data
  })
// 货主-库位关联表
// 库区分页查询
export const getOwnerLocationList = (params: any) =>
  request({
    url: '/ownerLocation/pageDetail',
    method: 'get',
    params
  })
// 详情
export const getLocationDetails = (id: any) =>
  request({
    url: `/ownerLocation/${id}`,
    method: 'get'
  })
// 新增
export const addOwnerLocation = (data: any) =>
  request({
    url: '/ownerLocation',
    method: 'post',
    data
  })
// 编辑
export const updateOwnerLocation = (data: any) =>
  request({
    url: '/ownerLocation',
    method: 'put',
    data
  })
// 删除
export const deleteOwnerLocation = (params: any) =>
  request({
    url: '/ownerLocation',
    method: 'delete',
    params
  })
// 货主批量关联库位
export const batchOwnerLocation = (data: any) =>
  request({
    url: '/ownerLocation/batch',
    method: 'post',
    data
  })
// 树
export const getTreeList = (id: String) =>
  request({
    url: `/area/tree?仓库id=${id}`,
    method: 'get'
  })
// 查询全部货主管理
export const getAllOwner = (params: any) =>
  request({
    url: '/owner/list',
    method: 'get',
    params
  })
